package cp3120.model.pricing;

import java.util.List;
import java.util.Map;
import java.util.Vector;

/**
 *
 * @author Adam Scarr <scarr.adam@gmail.com>
 */
public class PricingStrategyFactory {
    public static PricingStrategy createPricingStrategy(String className, Map<String, String> vars) {
        PricingStrategy result = null;
        try {
            result = (PricingStrategy) Class.forName(className).newInstance();

            for (String key: vars.keySet()) {
                String value = vars.get(key);
                result.setVar(key, value);
            }

        } catch (Exception e) {
            // No time dont care
            e.printStackTrace();
        }

        return result;
    }

    public static List<PricingStrategy> getAvailablePricingStrategys() {
        List<PricingStrategy> list = new Vector<PricingStrategy>();

        list.add(new DiscountNthTicket());

        return list;
    }
}
